# Copyright (C) 2010 Razvan Constantin <razvan.constantin@rconst.net>
#
# This file is part of FileBow.
#
# FileBow is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# FileBow is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with FileBow.  If not, see <http:#www.gnu.org/licenses/>.

# Build script for Geany FileBow plugin.

import Options

def configure(conf):
  conf.configure_gtk()
  conf.configure_geany()

def build(bld):
  bld.library('ui')

  bld.new_task_gen(
      features = 'cc cstaticlib',
      name = 'ui#geany-bridge',
      target = 'ui#geany-bridge',
      source = [ 'geany-bridge.c' ],
      includes = bld.srcnode.abspath(),
      uselib = 'GTK GEANY',
      install_path = None)

  bld.build_target(
      name = 'navigate-dlg',
      deps = ('geany-bridge', 'common#common', 'logic#navigator'),
      libs = ('GTK', 'POCO',),
      test = False)
  bld.build_target(
      name = 'plugin',
      deps = ('navigate-dlg', 'common#common', 'logic#navigator'),
      libs = ('GTK', 'POCO',),
      test = False)

  if Options.options.test:
    bld.new_task_gen(
        features = 'cxx cprogram',
        name = 'navigate-dlg.test',
        target = 'ui#navigate-dlg.test',
        source = [ 'navigate-dlg.cpp', 'navigate-dlg_test.cpp' ],
        uselib = 'POCO GTK GEANY',
        includes = bld.srcnode.abspath(),
        defines = [ 'NAVIGATE_DLG_TEST' ],
        uselib_local = 'common#common logic#navigator common#strings',
        install_path = None)
